<template>
  <el-form>
    <el-form-item label="姓名">
      <el-input v-model="form.name"></el-input>
    </el-form-item>
    <el-form-item label="班级">
      <el-input v-model="form.sclass"></el-input>
    </el-form-item>
    <el-form-item label="学号">
      <el-input v-model="form.code"></el-input>
    </el-form-item>
  </el-form>
</template>

<script>
import EventBus from "@/lib/event-bus";

export default {
  name: "StudentForm",
  data() {
    return {
      form: {
        name: '',
        sclass: '',
        code: ''
      }
    }
  },
  methods: {
    takeFormData() {
      return {...this.form}
    }
  },
  created() {
    EventBus.$on('form-submit', (p) => {
      p.callback(this.takeFormData());
    });
  }
}
</script>

<style scoped>

</style>